package com.niit.mall.common.utils;


/**
 * @BelongsProject: pardo_mall_backend
 * @BelongsPackage: com.niit.mall.common.utils
 * @Author: ChuXuan
 * @CreateTime: 2025-05-29  01:12
 * @Description: User上下文配置
 * @Version: 1.0
 */

public class UserContext {
	private static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<>();
	public static void setUser(Long userId) {
		THREAD_LOCAL.set(userId);
	}
	public static Long getUser() {
		return THREAD_LOCAL.get();
	}
	public static void removeUser() {
		THREAD_LOCAL.remove();
	}
}
